#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include "city.h"
#include <QMap>
#include <QVector>
#include <QFile>
#include <QDebug>
#include <QSet>
#include "city_add_dialog.h"
#include "city_search_dialog.h"
#include "city_modify_dialog.h"
#include "Net_work.h"
#include"forecast_dialog.h"
QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT
private:
    void readFile();
    void writerFile();

    void printTableHead(QStringList head);
    void printTable(QVector<City>& vc);
    void printCountryTable(QVector<City>& vc);

    void setCityName();
    void setCountryName();

    QStringList setTablehead(QString str);
    QVector<City> setTableValue(QString str);
public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

private slots:
    void on_pushButton_city_add_clicked();

    void on_pushButton_city_delete_clicked();

    void on_pushButton_city_search_clicked();

    void on_pushButton_city_modify_clicked();

    void on_pushButton_country_search_clicked();

    void on_pushButton_city_see_clicked();

    void on_pushButton_country_delete_clicked();


    void on_pushButton_count_new_clicked();

    void on_pushButton_count_now_clicked();

    void on_pushButton_count_all_clicked();

    void on_pushButton_count_cure_clicked();

    void on_pushButton_count_dead_clicked();

    void on_pushButton_forecast_clicked();

private:
    Ui::Widget *ui;
    city_add_Dialog* city_add_dialog;
    city_search_Dialog* city_search_dialog;
    city_modify_Dialog* city_modify_dialog;
    forecast_Dialog* forecast_dialog;
    QMap<QString, City> city;
    QStringList TableHead_city;
    QStringList TableHead_country;
    QSet<QString> city_name;
    QSet<QString> country_name;
    bool Table_flag;

};
#endif // WIDGET_H
